package com.xx.news.activity;

import android.annotation.TargetApi;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

import androidx.databinding.library.baseAdapters.BR;

import com.bumptech.glide.Glide;
import com.xx.news.R;
import com.xx.news.base.BaseActivity;
import com.xx.news.databinding.ActivityToutiaoInfoBinding;
import com.xx.news.entity.Toutiao;
import com.xx.news.viewmodel.ToutiaoInfoViewModel;

public class ToutiaoInfoActivity extends BaseActivity<ActivityToutiaoInfoBinding, ToutiaoInfoViewModel> {

    @Override
    public void initData() {
        super.initData();
        Intent intent = getIntent();
        Toutiao.T1348647853363Bean item = (Toutiao.T1348647853363Bean) intent.getSerializableExtra("bean");
        viewModel.item.set(item);

        Glide.with(this)
                .asBitmap()
                .load(item.getImgsrc().replace(",", ":"))
                .into(binding.image);
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_toutiao_info;
    }
}
